import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'


// 引入全局uView
import uView from 'uview-ui';
Vue.use(uView);

import store from './store/index'
Vue.prototype.$store = store;

//全局方法
Vue.prototype.$isNotNull = function(val) {
	if (val != null && val.length > 0) {
		return true;
	} else {
		return false;
	}
}

//将输入空格变成html 空格
Vue.prototype.$tranText = function(val) {
	if (val != null && val.length > 0) {
		val = val.replace(/\s/g, '&ensp;');

		if (val.length > 18) {
			let v = ""
			for (var i = 1; i < val.length; i++) {
				v = v + val.charAt(i)
				if (i % 17 == 0) {
					v = v + "<br>"
				}
			}
			val = v;
		}
		val = val + "&ensp;&ensp;"
	}

	return val;
}

const app = new Vue({
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif